package com.tqfframe.website.web.config.domain;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 唐祺峰
 * @Date: 2020/12/28 0028 16:17
 * @Version 1.0
 */
public class FactoryTestBean  implements FactoryBean {

    //true是单例，false是非单例，可以看出默认为单例的
    @Override
    public boolean isSingleton() {
        return true;
    }
    //返回对象实例
    @Override
    public Object getObject() throws Exception {
        return new Car("宝马", 50);
    }

    ////bean的Class类型
    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }
}
